package com.tanhua.model.mongo;

import com.tanhua.model.db.UserInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class SimilarYou {
    private Integer id;     //用户编号
    private String avatar;  //头像

    public static SimilarYou init(UserInfo userInfo) {
        SimilarYou similarYou = new SimilarYou();
        BeanUtils.copyProperties(userInfo, similarYou);
        similarYou.setId(userInfo.getId().intValue());
        return similarYou;
    }
}
